/*
 * Copyright 2010-2012 Susanta Tewari. <freecode4susant@users.sourceforge.net>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

/*
* LHood.java
*
* Created on November 22, 2007, 9:10 AM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
 */
package genomemap.worker;

import genomemap.data.GDataSource;
import genomemap.data.JDataSource;
import genomemap.data.PDataSource;

/**
 * @author Susanta Tewari
 * @version 1.0
 * @created 08-Nov-2007 3:19:12 PM
 */
public abstract class LHood extends Worker implements Annealable {

    /**
     * for computing genetic likelihood
     */
    public static final int GLHOOD = 0;

    /**
     * for computing physical likelihood
     */
    public static final int PLHOOD = 1;

    /**
     * for computing joint likelihood
     */
    public static final int JLHOOD = 2;

    /**
     * likelihood value
     */
    private double lhood = 0.0;

    /**
     * true: gives verbose output
     */
    private boolean verbose = false;

    /**
     * order of genes/probes
     */
    private int[] order = null;

    /**
     * Constructs ...
     */
    LHood() {}

    /**
     *
     * @return
     */
    public abstract double getLogLikeliHood();

    public double getLhood() {
        return lhood;
    }

    boolean isVerbose() {
        return verbose;
    }

    /**
     * supposed to overridden in the respective subclasses, GLikeliHood,PlikeLiHood..
     */
    public void setGData(GDataSource newVal) {}

    public void setPData(PDataSource newVal) {}

    public void setJData(JDataSource newVal) {}

    /**
     *
     * @param newVal
     */
    void setLhood(double newVal) {
        lhood = newVal;
    }

    /**
     *
     * @param newVal
     */
    public void setVerbose(boolean newVal) {
        verbose = newVal;
    }

    /**
     * computes the function which is used for simulated annealing
     */
    @Override
    public abstract double compute();

    /**
     * order of genes/probes
     */
    @Override
    public int[] getOrder() {
        return order;
    }

    /**
     * order of genes/probes
     *
     * @param newVal
     */
    @Override
    public void setOrder(int[] newVal) {
        order = newVal;
    }
}
